home *** CD-ROM | disk | FTP | other *** search
- Path: nyx.cs.du.edu!not-for-mail
- From: anon23bf@nyx.cs.du.edu (A. N. Alias)
- Newsgroups: comp.lang.c++
- Subject: C++ complex numbers slow as molasses?
- Date: 6 Apr 1996 13:30:04 -0700
- Organization: University of Denver, Dept. of Math & Comp. Sci.
- Message-ID: <4k6k8c$8h4@nyx.cs.du.edu>
- NNTP-Posting-Host: nyx.nyx.net
- Keywords: Complex.h complex numbers speed
-
- I'm using the complex number implementation that came with
- GNU C++ (v2.4). It seems that basic complex arithmetic
- (+, -, *, /, exp) runs about 2.5 times slower than when I
- code the same thing in C! I realize that C++ could be a
- bit slower, but I thought that the speed difference would
- be far less drastic (esp. if the C++ compiler inlines the
- arithmetic operators, as the Complex.h declarations specify).
- In fact, I've read claims that C++ often runs just as fast
- as C for this kind of application.
-
- Is this normal? What, if anything, can I do to speed things
- up? It would be quite tedious to rewrite the code in C.
-
- Thanks,
-
- -Al
-
-